// 2023-03-09 11:04:20
import BaseModel from "../baseModel.js";

class UserModel extends BaseModel {
    /**
     * @param {UserModel} model 
     * @returns {}
     */
    constructor(model) {
        super(model);
        /* 自定义属性以及重载 */
        this.phone = UserModel.CheackNull(model.phone);
        this.password = UserModel.CheackNull(model.password);
        this.userName = UserModel.CheackNull(model.userName);
        this.gender = !isNaN(parseInt(model.gender)) ? parseInt(model.gender) : 2;  // 0:女;1；男;2：未知,默认值
        this.email = model.email;   // 电子邮件
        this.introduction = model.introduction;   // 个人介绍
        this.portraitSrc = model.portraitSrc; // 头像
        this.type = (model.type === undefined && model.type === null) ? 1 : model.type  // 0：管理员   1：用户
    }
    static Instance = 'usertable'
}
export default UserModel;